package com.kaikeba.util;

import com.kaikeba.bean.Admin;
import com.kaikeba.bean.Expressman;
import com.kaikeba.bean.User;

import javax.servlet.http.HttpSession;

public class UserUtil {
    public static String getUserName(HttpSession session){
        return "username";
    }

    public static String getUserPhone(HttpSession session){
        return "13843838438";
    }

    public static void setLoginSMS(HttpSession session, String phone, String code){
        session.setAttribute(phone, code);
    }

    public static String getLoginCode(HttpSession session, String phone){
        return (String) session.getAttribute(phone);
    }

    public static void setWxUser(HttpSession session, User user){
        session.setAttribute("wxUser", user);
    }

    public static User getWxUser(HttpSession session){
        return (User) session.getAttribute("wxUser");
    }

    public static void setWxAdmin(HttpSession session, Admin admin){
        session.setAttribute("wxAdmin", admin);
    }

    public static Admin getWxAdmin(HttpSession session){
        return (Admin) session.getAttribute("wxAdmin");
    }

    public static void setWxExpressman(HttpSession session, Expressman expressman){
        session.setAttribute("wxExpressman", expressman);
    }

    public static Expressman getWxExpressman(HttpSession session){
        return (Expressman) session.getAttribute("wxExpressman");
    }
}
